export default function (app) {
	function fileUploaderService() {
		'ngInject';

		this.defaultOpt = {
			auto: true,
			swf: 'http://cdn.staticfile.org/webuploader/0.1.0/Uploader.swf',
			duplicate: true,
			fileNumLimit: 50,
			accept: {
		    title: 'Images',
		    extensions: 'gif,jpg,jpeg,bmp,png',
		    mimeTypes: 'image/*',
			},
		};

		this.initUploader = (opt) => {
			const uploader = WebUploader.create(angular.extend(this.defaultOpt, opt));
			return uploader;
		};

	}
	app.service('fileUploaderService', fileUploaderService);
}
